<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>康熙健康体检系统 - 客户查询</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Microsoft YaHei', sans-serif;
        }
        
        body {
            background-color: #f5f7fa;
            color: #333;
        }
        
        .header {
            background-color: #1a5276;
            color: white;
            padding: 20px 0;
            text-align: center;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
        
        .header h1 {
            font-size: 28px;
            margin-bottom: 10px;
        }
        
        .container {
            max-width: 1200px;
            margin: 30px auto;
            padding: 0 20px;
        }
        
        .search-panel {
            background-color: white;
            border-radius: 10px;
            padding: 25px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            margin-bottom: 30px;
        }
        
        .search-title {
            color: #1a5276;
            margin-bottom: 20px;
            font-size: 20px;
            font-weight: 500;
        }
        
        .search-form {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 20px;
        }
        
        .form-group {
            margin-bottom: 15px;
        }
        
        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: #555;
            font-weight: 500;
        }
        
        .form-group input, 
        .form-group select {
            width: 100%;
            padding: 12px 15px;
            border: 1px solid #ddd;
            border-radius: 5px;
            font-size: 14px;
        }
        
        .search-buttons {
            display: flex;
            justify-content: flex-end;
            gap: 15px;
            margin-top: 10px;
            grid-column: 1 / -1;
        }
        
        .search-btn {
            padding: 12px 25px;
            background-color: #3498db;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
            transition: background-color 0.3s;
        }
        
        .search-btn:hover {
            background-color: #2980b9;
        }
        
        .reset-btn {
            padding: 12px 25px;
            background-color: #95a5a6;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
            transition: background-color 0.3s;
        }
        
        .reset-btn:hover {
            background-color: #7f8c8d;
        }
        
        .result-panel {
            background-color: white;
            border-radius: 10px;
            padding: 25px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        }
        
        .result-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        
        .result-title {
            color: #1a5276;
            font-size: 20px;
            font-weight: 500;
        }
        
        .export-btn {
            padding: 8px 15px;
            background-color: #2ecc71;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
            transition: background-color 0.3s;
        }
        
        .export-btn:hover {
            background-color: #27ae60;
        }
        
        .customer-table {
            width: 100%;
            border-collapse: collapse;
        }
        
        .customer-table th, 
        .customer-table td {
            padding: 15px;
            text-align: left;
            border-bottom: 1px solid #eee;
        }
        
        .customer-table th {
            background-color: #f8f9fa;
            color: #555;
            font-weight: 500;
        }
        
        .customer-table tr:hover {
            background-color: #f8f9fa;
        }
        
        .action-btn {
            padding: 5px 10px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 12px;
            transition: all 0.3s;
        }
        
        .action-btn.view {
            background-color: #3498db;
            color: white;
        }
        
        .action-btn.history {
            background-color: #9b59b6;
            color: white;
        }
        
        .action-btn:hover {
            opacity: 0.8;
        }
        
        .no-data {
            text-align: center;
            padding: 50px;
            color: #777;
        }
        
        .pagination {
            display: flex;
            justify-content: center;
            margin-top: 30px;
        }
        
        .pagination button {
            padding: 8px 15px;
            margin: 0 5px;
            border: 1px solid #ddd;
            background-color: white;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .pagination button.active {
            background-color: #1a5276;
            color: white;
            border-color: #1a5276;
        }
        
        .pagination button:hover:not(.active) {
            background-color: #f1f1f1;
        }
        
        @media (max-width: 768px) {
            .search-form {
                grid-template-columns: 1fr;
            }
            
            .customer-table {
                display: block;
                overflow-x: auto;
            }
        }
    </style>
</head>
<body>
    <div class="header">
        <h1>康熙健康体检系统</h1>
        <p>体检客户查询</p>
    </div>
    
    <div class="container">
        <div class="search-panel">
            <h3 class="search-title">客户查询条件</h3>
            <form class="search-form" id="searchForm">
                <div class="form-group">
                    <label for="customerName">客户姓名</label>
                    <input type="text" id="customerName" name="customerName" placeholder="请输入客户姓名">
                </div>
                
                <div class="form-group">
                    <label for="phone">手机号码</label>
                    <input type="text" id="phone" name="phone" placeholder="请输入手机号码">
                </div>
                
                <div class="form-group">
                    <label for="idCard">身份证号</label>
                    <input type="text" id="idCard" name="idCard" placeholder="请输入身份证号">
                </div>
                
                <div class="form-group">
                    <label for="customerType">客户类型</label>
                    <select id="customerType" name="customerType">
                        <option value="">全部</option>
                        <option value="personal">个人客户</option>
                        <option value="enterprise">企业客户</option>
                        <option value="vip">VIP客户</option>
                    </select>
                </div>
                
                <div class="form-group">
                    <label for="registerDateStart">注册日期范围</label>
                    <input type="date" id="registerDateStart" name="registerDateStart">
                </div>
                
                <div class="form-group">
                    <label for="registerDateEnd">至</label>
                    <input type="date" id="registerDateEnd" name="registerDateEnd">
                </div>
                
                <div class="search-buttons">
                    <button type="reset" class="reset-btn">重置条件</button>
                    <button type="button" class="search-btn" onclick="searchCustomers()">查询客户</button>
                </div>
            </form>
        </div>
        
        <div class="result-panel">
            <div class="result-header">
                <h3 class="result-title">查询结果</h3>
                <button class="export-btn">导出查询结果</button>
            </div>
            
            <table class="customer-table">
                <thead>
                    <tr>
                        <th>客户编号</th>
                        <th>姓名</th>
                        <th>性别</th>
                        <th>手机号</th>
                        <th>身份证号</th>
                        <th>客户类型</th>
                        <th>注册日期</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>KH20250610001</td>
                        <td>张三</td>
                        <td>男</td>
                        <td>13800138001</td>
                        <td>110***********1234</td>
                        <td>VIP客户</td>
                        <td>2025-01-15</td>
                        <td>
                            <button class="action-btn view">查看</button>
                            <button class="action-btn history">体检记录</button>
                        </td>
                    </tr>
                    <tr>
                        <td>KH20250610002</td>
                        <td>李四</td>
                        <td>女</td>
                        <td>13800138002</td>
                        <td>110***********5678</td>
                        <td>企业客户</td>
                        <td>2025-03-20</td>
                        <td>
                            <button class="action-btn view">查看</button>
                            <button class="action-btn history">体检记录</button>
                        </td>
                    </tr>
                    <tr>
                        <td>KH20250610003</td>
                        <td>王五</td>
                        <td>男</td>
                        <td>13800138003</td>
                        <td>110***********9012</td>
                        <td>个人客户</td>
                        <td>2025-05-10</td>
                        <td>
                            <button class="action-btn view">查看</button>
                            <button class="action-btn history">体检记录</button>
                        </td>
                    </tr>
                </tbody>
            </table>
            
            <div class="pagination">
                <button>&laquo;</button>
                <button class="active">1</button>
                <button>2</button>
                <button>3</button>
                <button>&raquo;</button>
            </div>
        </div>
    </div>
    
    <script>
        // 搜索客户
        function searchCustomers() {
            const name = document.getElementById('customerName').value.trim();
            const phone = document.getElementById('phone').value.trim();
            const idCard = document.getElementById('idCard').value.trim();
            const customerType = document.getElementById('customerType').value;
            const dateStart = document.getElementById('registerDateStart').value;
            const dateEnd = document.getElementById('registerDateEnd').value;
            
            // 这里可以添加表单验证逻辑
            if (!name && !phone && !idCard && !customerType && !dateStart && !dateEnd) {
                alert('请输入至少一个查询条件');
                return;
            }
            
            // 模拟查询成功
            alert('执行查询: 姓名=' + name + ', 手机=' + phone + ', 身份证=' + idCard + 
                  ', 类型=' + customerType + ', 日期范围=' + dateStart + '至' + dateEnd);
            
            // 实际应用中这里应该是AJAX请求查询数据
            // console.log('Search criteria:', {
            //     name, phone, idCard, customerType, dateStart, dateEnd
            // });
        }
        
        // 导出查询结果
        document.querySelector('.export-btn').addEventListener('click', function() {
            alert('导出查询结果功能');
            // 实际应用中这里应该是导出数据
        });
        
        // 操作按钮事件
        document.querySelectorAll('.action-btn.view').forEach(btn => {
            btn.addEventListener('click', function() {
                const customerId = this.closest('tr').cells.textContent;
                alert('查看客户详情: ' + customerId);
                // 实际应用中这里应该是跳转到客户详情页
                // location.href = 'customer-detail.html?id=' + customerId;
            });
        });
        
        document.querySelectorAll('.action-btn.history').forEach(btn => {
            btn.addEventListener('click', function() {
                const customerId = this.closest('tr').cells.textContent;
                alert('查看体检记录: ' + customerId);
                // 实际应用中这里应该是跳转到体检记录页
                // location.href = 'medical-history.html?id=' + customerId;
            });
        });
        
        // 分页按钮事件
        document.querySelectorAll('.pagination button').forEach(btn => {
            btn.addEventListener('click', function() {
                if (!this.classList.contains('active')) {
                    document.querySelector('.pagination .active').classList.remove('active');
                    this.classList.add('active');
                    alert('切换到第 ' + this.textContent + ' 页');
                    // 实际应用中这里应该是AJAX请求分页数据
                }
            });
        });
        
        // 设置默认日期范围为最近3个月
        window.onload = function() {
            const endDate = new Date();
            const startDate = new Date();
            startDate.setMonth(endDate.getMonth() - 3);
            
            document.getElementById('registerDateStart').valueAsDate = startDate;
            document.getElementById('registerDateEnd').valueAsDate = endDate;
        };
    </script>
</body>
</html>
